#pragma once

#include "RHITexture.h"
#include <string>

class Picture2DTexture : public RHITexture
{
	struct BuilderDetails {

		uint32 mipLevels;
		VkFormat format;
		VkSharingMode sharingMode;
		std::vector<VkQueueFlagBits> queueFamilys;

		std::string path;

		BuilderDetails()
		{
			mipLevels = 1;
			format = VK_FORMAT_R8G8B8A8_SRGB;
			sharingMode = VK_SHARING_MODE_EXCLUSIVE;
		}
	};

public:

	class Builder : public BuilderBase<BuilderDetails> {
		friend struct BuilderDetails;
	public:
		Builder() noexcept;
		Builder(Builder const& rhs) noexcept;
		Builder(Builder&& rhs) noexcept;
		~Builder() noexcept;
		Builder& operator=(Builder const& rhs) noexcept;
		Builder& operator=(Builder&& rhs) noexcept;

		Builder& SetAutoMip() noexcept;
		Builder& SetMipLevels(uint32 mipLevels) noexcept;
		Builder& SetFormat(VkFormat format) noexcept;
		Builder& SetSharingMode(VkSharingMode sharingMode) noexcept;
		Builder& AddQueueFamily(VkQueueFlagBits queueFlag) noexcept;
		Builder& SetPath(const std::string& path) noexcept;

		RefCountPtr<Picture2DTexture> Build();
		RefCountPtr<Picture2DTexture> Build(RenderProcess* process, const std::string& name);

	private:
		friend class Picture2DTexture;
	};

	Picture2DTexture(BuilderDetails& builderDetails);

	virtual void ReleaseResource() override;

protected:

	std::string mPath;
};

